package com.jt808.decode.utils;

import com.jt808.decode.model.Heartbeat;
import com.jt808.decode.model.Jt808Message;

/**
 * Analyzing heartbeat data
 * @date 20230303
 */
public class Message0002Parser {
    /**
     * Analyzing heartbeat data
     * @param msg
     * @return
     */
    public static Heartbeat parse(Jt808Message msg){
        Heartbeat heartbeat=new Heartbeat();
        heartbeat.setDeviceId(msg.getDeviceId());
        heartbeat.setHexMsgId(NumberUtil.formatMessageId(msg.getMsgId()));
        heartbeat.setMsgFlowId(msg.getMsgFlowId());
        return heartbeat;
    }
}
